import java.awt.Dimension;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;

public class City extends JLayeredPane{

	private static final long serialVersionUID = 1L;
	JLabel background;
	
	City(TerrainType type){
		JLabel label = new JLabel("", new ImageIcon(getClass().getResource("/Pics/city.gif")), JLabel.CENTER);
		setLayout(null);
		
		if(type == TerrainType.Lake)
			background = new JLabel("", new ImageIcon(getClass().getResource("/Pics/lake3.gif")) , JLabel.CENTER);
		else if(type == TerrainType.Sand)
			background = new JLabel("", new ImageIcon(getClass().getResource("/Pics/sand2.gif")) , JLabel.CENTER);
		else
			background = new JLabel("", new ImageIcon(getClass().getResource("/Pics/field3.gif")) , JLabel.CENTER);
		
		add(label, new Integer(1));
		add(background, new Integer(0));
		background.setBounds(0, 0, 24, 24);
		label.setBounds(0, 0, 24, 24);
		setSize(24,24);
	}
	@Override
	public Dimension getMinimumSize(){
		return new Dimension(24,24);	
	}
	@Override
	public Dimension getMaximumSize(){
		return new Dimension(24,24);	
	}
	@Override
	public Dimension getPreferredSize(){
		return new Dimension(24,24);	
	}
}
